<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2020/12/17
 * Time: 16:11
 */

namespace app\adminapiv3\validate;


use think\Validate;

class InstallValidate extends Validate
{
    //验证规则
    protected $rule = [
        'key|序列号' => 'require',
        'ip|IP地址' => 'require|ip',
        'port|port' => 'require',
        'mysql|mysql' => 'require',
        'real_name|real_name' => 'require|length:1,50',
        'show_name|show_name' => 'require|length:1,50',
        'password|密码' => 'require|length:32',
    ];

    protected $scene = [
        //添加
        'online' => ['key'],

        //修改
        'addProxyIp' => ['ip','port','mysql'],

        'userConfig' => ['real_name','show_name','password'],
    ];
}